<template>
  <section class="app-main">
    <router-view v-slot="{ Component, route }">
      <transition name="fade-transform" mode="out-in">
        <keep-alive :include="store.tagView.cachedViews">
          <component v-if="!route.meta.link" :is="Component" :key="route.path" />
        </keep-alive>
      </transition>
    </router-view>
    <iframeToggle />
  </section>
</template>

<script setup>
import iframeToggle from "./IframeToggle/index.vue"
import store from '@/store/index.js'
</script>

<style lang="scss" scoped>
@use "@/assets/styles/variables.module" as layout;

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.app-main {
  width: 100%;
  min-height: calc(100vh - #{layout.$navbar-height});
  position: relative;
  overflow: hidden;
  box-sizing: border-box;

}

.fixed-header + .app-main {
  height: 100vh;
  overflow-y: scroll;
  /* 50= navbar  50  */
  padding-top: #{layout.$navbar-height};
}

.hasTagsView {
  .app-main {
    min-height: calc(100vh - #{layout.$navbar-height} - #{layout.$tags-view-height});
  }

  .fixed-header + .app-main {
    /* 84 = navbar + tags-view = 50 + 34 */
    padding-top: #{layout.$navbar-height + layout.$tags-view-height};
  }
}

</style>

<style lang="scss">

.el-popup-parent--hidden .fixed-header {
  padding-right: 0 !important;
}

.el-dialog__wrapper {
  overflow: hidden;
}

.el-table__empty-text {
  user-select: none !important;
}

// fix css style bug in open el-dialog
.el-popup-parent--hidden {
  .fixed-header {
    padding-right: 17px;
  }
}

</style>
